package com.longge;

import java.util.HashSet;

/**
 * @program: my-code
 * @description:
 * @author: longge
 * @create: 2021-06-02 22:55
 */
public class CountGoodSubstrings {

    public int countGoodSubstrings(String s) {

        int res = 0;
        for (int i = 0; i < s.length()-2; i++) {
            if (s.charAt(i) != s.charAt(i + 1) && s.charAt(i) != s.charAt(i + 2) && s.charAt(i+1) != s.charAt(i + 2)) {
               res++;
            }

        }
        return res;
    }


}
